package com.gdssoft.pdaweb.action;
/*
 *  捷达世软件（深圳）有限公司
 *  Copyright (C) 2008-2010 ShenZhen JieDaShi Software Limited Company.
*/
import java.util.List;
import javax.annotation.Resource;
import com.gdssoft.core.command.QueryFilter;
import com.gdssoft.core.web.action.BaseAction;
import com.gdssoft.pdaweb.model.PdaLog;
import com.gdssoft.pdaweb.service.PdaLogService;
import flexjson.JSONSerializer;
import flexjson.transformer.DateTransformer;

public class PdaLogAction extends BaseAction{
	
	@Resource
	private PdaLogService pdaLogService;
	/**
	 * 显示列表
	 */
	public String list(){
		QueryFilter filter=new QueryFilter(getRequest());
		List<PdaLog> list= pdaLogService.getAll(filter);
		JSONSerializer serializer=new JSONSerializer();
		StringBuffer buff = new StringBuffer("{success:true,'totalCounts':")
		.append(filter.getPagingBean().getTotalItems()).append(",result:");	
		serializer.transform(new DateTransformer("yyyy-MM-dd"), "createdDt");
		serializer.transform(new DateTransformer("yyyy-MM-dd"), "operateTime");
        buff.append(serializer.exclude(new String[] { "class" }).serialize(list));
		buff.append("}");
				
		jsonString=buff.toString();		
		return SUCCESS;		
	}
	
}
